using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Runtime.Remoting;


using MULENetworking;

namespace MainGame
{
    public partial class NewGame : Form
    {
        private IRemoteServer remoteServer;
        private int level;
        private string userName; //, map; never used

        public NewGame(IRemoteServer server, string myUserName)
        {
            InitializeComponent();
            remoteServer = server;
            userName = myUserName;
            level = 0;
            Beginner.Select();
        }

        private void label1_Click(object sender, EventArgs e)
        {

        }

        private void radioButton1_CheckedChanged(object sender, EventArgs e)
        {
            level = 0;
        }

        private void Cancel_Click(object sender, EventArgs e)
        {
            this.Hide();
        }

        private void Create_Click(object sender, EventArgs e)
        {
           // if (MapList.Text == null || level == null)
           // {
                // do nothing
           // }
           // else
           // {
                //remoteServer.CreateGame(userName); 
                //this.Hide();
           // }
        }

        private void GameName_TextChanged(object sender, EventArgs e)
        {

        }

        private void Standard_CheckedChanged(object sender, EventArgs e)
        {
            level = 1;
        }

        private void Tournament_CheckedChanged(object sender, EventArgs e)
        {
            level = 2;
        }

        private void MapList_SelectedIndexChanged(object sender, EventArgs e)
        {
            /*
            switch (mapindex)
            {
                case 0: map = "Food";
                    break;
                case 1: map = "Mining";
                    break;
                case 2: map = "Energy";
                    break;
                case 3: map = "Standard";
                    break;
            }
            */
        }

        private void createB_Click(object sender, EventArgs e)
        {
            remoteServer.CreateGame(userName, GameName.Text, level);
            this.Hide();
        }
    }
}